<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>lodash测试</title>
</head>
<body>
    
</body>
<!-- <script src="./index.js"></script> -->
<script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>
<script>
    console.log(_,"loash:")

    let arr0 = [1,2,3,4,5,6,7,8,9,10]

    // chunk(arr,[size=1]) 数组按照size长度进行分割，返回为二维数组。
    let res0 = _.chunk(arr0,2)
    console.log({res0})//output: [[1,2],[3,4],[5,6],[7,8],[9,10]]


    let arr1 = [0,'',1,undefined,2,3,false,4,5,6]

    //compact(arr),把数组里的 逻辑假 值 都剔除掉。
    let res1 = _.compact(arr1)
    console.log({res1})//output: [1, 2, 3, 4, 5, 6]
    
    let arr2 = []

</script>
</html>